-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assets version doesn't depend on asset host if it's a Proc #140
Conversation
@@ -74,10 +74,16 @@ def configure(&block) | |||
app.assets.version, | |||
config.assets.version, | |||
config.action_controller.relative_url_root, | |||
config.action_controller.asset_host, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we've already got a compact
on this array, I think we can just use an inline conditional...
config.action_controller.asset_host unless config.action_controller.asset_host.respond_to?(:call),
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but I found inline condition inside an array too complex, it doesn't even fit one line )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer @matthewd version than doing the operation two times.
This fixes it for us. We are using a proc for the asset host. I'm really curious though - what is the use case where you would want to change the fingerprint on an asset just because the asset host changes? If the content of the asset hasn't changed what's the point? |
If asset host changes the content also change since the assets url inside
|
Okay. I would have expected the fingerprint to change because the content On Mon, Apr 21, 2014 at 11:00 AM, Rafael Mendonça França <
|
Well yes, that's the whole point: this is about the fingerprint of the source file(s), so sprockets knows whether it needs to recompile. |
rebased, inline conditional |
assets version doesn't depend on asset host if it's a Proc
assets version doesn't depend on asset host if it's a Proc
Just spent quite some time figuring out why assets on two nodes got different fingerprints after a deployment. Thank you for fixing this! Hopefully the fix will be published to Rubygems soon. |
assets version doesn't depend on asset host if it's a Proc
Same here. Took me about half a day downtime to get to this. I hope we can expect a release soon :) |
Same here. I'm glad this is fixed but I don't care much for the approach. IMHO the digest of identical files should be identical and not depend on where they are hosted. The downside of the current approach is that the files on a staging server will always be different from a production server which would typically use a different asset host. I understand that this is done as a hack to make sprockets realise the contents of a CSS file can change depending on the asset_host, but can't we think of something more elegant? Detecting whether the asset host is referenced anywhere in the file perhaps? |
@rafaelfranca Any chance this could be released in a 2.1.4 version? It's giving us inconsistent assets across multiple machines which is a pretty serious bug IMO. |
@braddunbar Released |
this pr is replacement for #139
fixes #138